/**
 * School Class
 * A medium to integrate teachers and students.
 *
 *  @author John Thomason
 *  Date: Fall 2008
 *  Course: CS222
 *  Seminar: 6
 *  Assign: Final Exam Part B
 *      
 */
import java.util.*;

public class School {

//INSTANCE VARIABLES

    private ArrayList<Teacher> teachers = new ArrayList<Teacher>();
    private ArrayList<Student> students = new ArrayList<Student>();

    
//REQUIRED AND OPTIONAL METHODS

    /**
     * Add a student to the list of students at this school
     * @param student   A Student Object
     */
    public void goToSchool (Student student) {
        students.add(student);
    }//goToSchool()

    /**
     * Add a teacher to the list of teachers at this school
     * @param teacher   A Teacher object
     */
    public void hireTeacher (Teacher teacher) {
        teachers.add(teacher);
    }//hireTeacher()

    /**
     * Remove a student from the list of students at this school
     * @param student   The Student object to remove
     * @return          The removed Student object
     */
    public Student gradStudent (Student student) {
        students.remove(student);
        return student;
    }//gradStudent()

    /**
     * Remove a teacher for the list of teachers at this school
     * @param teacher   The Teacher object to remove
     * @return          The removed Teacher object
     */
    public Teacher fireTeacher (Teacher teacher) {
        teachers.remove(teacher);
        return teacher;
    }//fireTeacher()

    /**
     * Build a detailed list of all the teachers at this school
     * @return  A string representing the list of teachers
     */
    public String getTeachers () {
        StringBuilder sOut = new StringBuilder(512);
        for (Teacher t: teachers){ sOut.append(t); }
        return sOut.toString();
    }//getTeachers()

    /**
     * Build a detailed list of all students at this school
     * @return  A string representing the list of students
     */
    public String getStudents () {
        StringBuilder sOut = new StringBuilder(512);
        for (Student s: students){ sOut.append(s); }
        return sOut.toString();
    }//getStudents()


//OVERRIDDEN METHODS

    /**
     * A detailed list of All teachers and students at this school
     * @return  A string representing the list of teachers and students
     */
    @Override
    public String toString () {
        return String.format("\nTeachers:\n%s\nStudents:\n%s\n",
                              getTeachers(), getStudents());

    }//toString()


//ENUMERATOR SUB-CLASSES

    /**
     * An enumeration of available degrees
     */
    public enum Degree {

        AAS, BS, MS, PHD;

    }//Degree enum

    /**
     * An enumeration of available subjects
     */
    public enum Subject {

        CS, MIS, MAT, BIO, PSY, HUM, PHY, ENG,;

    }//Subject enum

}//School Class

